<?php
include('../config.inc.php');
include('../runid.php');
$user_see = $_POST['user_see'];
$sql = "SELECT d.day_in,d.no,d.problem,d.day_process,d.day_complete,fa.fault_name,lo.site_name,st.status_id,
u1.name as unote,u1.unit_code as unote_unit,u1.pnthai as unote_pn, u1.tel as unote_tel,u1.fax as unote_fax,u1.office as unote_office,
u2.name as upro,u2.unit_code as upro_unit,u2.pnthai as upro_pn,u2.tel as upro_tel,u2.fax as upro_fax,u2.office as upro_office
FROM detail d
join fault_type fa on d.fault_type = fa.id
join location lo on d.location_id = lo.location_id
join status_type st on d.status = st.status_id
join users u1 on d.username_note = u1.username 
join users u2 on d.username_process = u2.username 
where d.username_note = '$user_see'";
$result = mysql_query($sql);
while($arr=mysql_fetch_array($result)){
	echo "วันที่รับแจ้ง ".$arr[day_in]."<br>";
}
?>
